
<?php echo $err ?>

<div id="featured"  class="grid_16">
			<div id="fmeta" class="grid_6 alpha">
				<h3>Recent Designs</h3>
				<?php foreach($recent->result() as $row) {
					echo anchor('designs/thread/' . $row->threadid, img('designs/small_'.$row->image));
				}
				?>
			</div>
			<div id="fcontent" class="grid_10 omega">
							<h3>Latest design</h3>
			 <?=$lastimage?>
			</div>
		</div>
		<div id="dash">
			<div class="grid_6" id="discussions">
				<h3>Recent Discussions</h3>
				<ol class="list">
					<?php foreach($discussions->result() as $row) { ?>
					<li><p><strong><?=$row->count?></strong> replies</p><h4><?=anchor('discussions/single/' . $row->did, $row->title)?> </h4>
	</li>
	<?php } ?>
				</ol>
			</div>
			<div class="grid_5">
				<h3>Upcoming todos</h3>
				<ol class="list">
					<?php foreach($todos->result() as $row) { ?>
					<li>
					<p><?=$row->thedate?></p>
					<h4><?=$row->description?></h4>
					
					</li>
					<?php } ?>
				</ol>
			</div>
			<div class="grid_5" id="files">
				<h3>Files</h3>
				<ol>
				<?php
				// Some trickery with the files array to only display up to 5 files
				// If anybody knows of a better way to do this, I would love to hear it...
				if (count($files) >= 5) {
				$i = -1;
				while($i<=3)
				{ 
				$i++; ?>
				<li><a href="files/<?=$files[$i]?>"><?=$files[$i]?></li>
				<?php }}
				else {
				foreach($files as $file) { 
				?>
				<li><a href="files/<?=$file?>"><?=$file?></a></li>
				<?php }} ?>
				</ol>
			</div>
		</div>